package source.model;

import source.model.type.TerrainType;

public class Planet extends Terrain{

	private int ORE_SCALE_FACTOR = 200;
	private int ENERGY_SCALE_FACTOR = 200;
	private int MANPOWER_SCALE_FACTOR = 150;
	
	private int ore;
	private int energy;
	private int manpower;
	
	public Planet(){

		super(TerrainType.PLANET);
		ore=(int)(Math.random()*ORE_SCALE_FACTOR);
		energy=(int)(Math.random()*ENERGY_SCALE_FACTOR);
		manpower=(int)(Math.random()*MANPOWER_SCALE_FACTOR);
	}
	public int getOre()
	{
		return ore;
	}
	
	public int getEnergy()
	{
		return energy;
	}
	
	public int getManPower()
	{
		return manpower;
	}
	
	public int extractOre(int extract){
		if (ore >= extract){
			ore -= extract;
			return extract;
		}
		else
		{
		int temp = ore;
		ore = 0;
		return temp;
		}
	}

}
